from django.contrib import admin
from .models import MonitoringCategory, MonitoringData

@admin.register(MonitoringCategory)
class MonitoringCategoryAdmin(admin.ModelAdmin):
    list_display = ('name', 'description', 'created_at')
    search_fields = ('name', 'description')

@admin.register(MonitoringData)
class MonitoringDataAdmin(admin.ModelAdmin):
    list_display = ('category', 'location', 'value', 'unit', 'status', 'measured_at', 'created_by')
    list_filter = ('category', 'status', 'measured_at')
    search_fields = ('location', 'notes')
    date_hierarchy = 'measured_at'
